import { ComponentProps, Hook, VueComponent } from "vue3-oop"
import { NFormItem,NDatePicker } from 'naive-ui';
import TimepickerProps from './TimepickerProps'
import styles from './TimepickerDraft.module.scss'
import { FormData,WidgetNode } from '../../../types'

interface IProps {
  formData: FormData,
  widgetNode: WidgetNode
}
export default class TimepickerDraft extends VueComponent<IProps> {
  static defaultProps: ComponentProps<IProps> = {
    formData: {},
    widgetNode: {}
  }

  constructor() {
    super();
  }

  render(){
    const { widgetNode } = this.props;
    const widgetProps = widgetNode.widgetProps as TimepickerProps;

    const isRequired = widgetProps.layout_status==='4'

    return(
      <NFormItem
        label={widgetProps.field_label}
        labelPlacement="left"
        labelAlign={widgetProps.formitem_labelAlign}
        labelWidth={widgetProps.formitem_labelWidth}
      >
        <NDatePicker
          onUpdateValue={(value)=>{console.log(value);}}
        />
      </NFormItem>
    )
  }
}